﻿@using CoralNode.Core.Entity.Enums
@using CoralNode.MvcClient.Helper
@using Coralcode.Base.Utils
@model CoralNode.Core.Entity.SearchQuerys.Prototype.PrototypeSearchQuery

@{
    ViewBag.Title = "Index";
}

@Html.IncludePage("CoralAdmin/prototype", "_Left", new { current = "prototype" })
<div id="pbody">
    <div class="extra">
        <div class="pbody_top">
            <span class="ico ico_setting_setting"></span><span class="t t_c">内容设计&nbsp;&nbsp;/&nbsp;&nbsp;原型管理</span>
        </div>
        <div id="main">
            <div class="">
                <div class="tablelist_style1" data-js="tabellist_style1">
                    <div class="funsearch p_1 pl_2 pr_2 extra_normal">
                        <a class="btn_5 f_r ml_3" href="/m/prototype/createPrototype">添加原型</a>
                        <div class="f_r">
                            <form method="POST" action="/m/prototype/listPrototype">
                                <label class="search f_l">
                                    @Html.TextBoxFor(m => m.Title, new { @class = "text w_18", @msg = "请输入关键字" })
                                    @Html.AntiForgeryToken()
                                    <input type="submit" value="" class="submit" />
                                </label>
                            </form>
                        </div>
                    </div>
                    <table cellpadding="0" cellspacing="0">
                        <tr class="exclude">
                            <th width="60">选择</th>
                            <th align="left" width="50">ID</th>
                            <th align="left">名称</th>
                            <th align="left">编码</th>
                            <th>排序</th>
                            <th align="center" width="240">操作</th>
                        </tr>
                        @foreach (var item in @ViewBag.PrototypeList.Items) {
                            <tr data-depth="1">
                                <td>
                                    <label class="checkbox_own">
                                        <input type="checkbox" value="@item.Id"/></label></td>
                                <td class="td_left">@item.Id</td>
                                <td class="td_left"><a href="/m/prototype/editPrototype/@item.Id">@item.Title</a>
                                </td>
                                <td class="td_left">@item.Code</td>
                                <td><a href="/m/prototype/ChangePrototypeRank/@item.Id" class="ico ico_moveup mr_2 f_no  btn">
                                </a><a href="/m/prototype/ChangePrototypeRank/@item.Id" class="ico ico_movedown btn">
                                </a>
                                </td>
                                <td>
                                    <div class="fun">
                                        <a href="/m/node/listNode?prototypeId=@item.Id">内容管理</a><a href="/m/prototype/editPrototype/@item.Id">原型管理</a><a href="/m/prototype/deletePrototype/@item.Id" class="js_delete">删除</a>
                                    </div>
                                </td>
                            </tr>
                        }
                    </table>
                    <div class="global_fun ">
                        <label class="checkbox_own gloabal_select">
                            <input type="checkbox" /></label>
                        <input type="button" class="btn_4 btn invert" value="反选" /><input type="button" class="btn_4 btn reset"
                            value="重置" />
                        <a href="#" class="js_delete">删除</a>
                    </div>
                </div>

            </div>
        </div>
        <div id="pager">
            <div class="info_pg">共@(ViewBag.PrototypeList.TotalItems)条</div>
            <div class="list_pg">
                <a href="/m/prototype/listPrototype?@ViewBag.queryString&p=1" class="first">首页</a>
                @if (@ViewBag.PrototypeList.HasPreviousPage && @ViewBag.PrototypeList.TotalItems > 0) {
                    <a href="/m/prototype/listPrototype?@ViewBag.queryString&p=@ViewBag.PrototypeList.PreviousPageIndex" class="prev">
                        上一页</a>
                } else {
                    <a class="prev none">上一页</a>
                }
                @foreach (var i in @ViewBag.PrototypeList.PageArray) {
                    if (@i == @ViewBag.PrototypeList.CurrentPageIndex) {
                    <a class="current">@i</a>
                    } else if (@i == 0) {
                    <a class="more">…</a>
                    } else {
                    <a href="/m/prototype/listPrototype?@ViewBag.queryString&p=@i" href="#">@i</a>
                    }
                }
                @if (@ViewBag.PrototypeList.HasNextPage && @ViewBag.PrototypeList.TotalItems > 0) {
                    <a class="next" href="/m/prototype/listPrototype?@ViewBag.queryString&p=@ViewBag.PrototypeList.NextPageIndex">
                        下一页</a>
                } else {
                    <a class="next none">下一页</a>
                }
                <a class="last" href="/m/prototype/listPrototype?@ViewBag.queryString&p=@ViewBag.PrototypeList.TotalPages">
                    尾页</a>
                <!-- <span class="msg">跳转</span>
                <input class="text" type="text" value="">
                <span class="msg">页</span>-->
            </div>
        </div>
    </div>
</div>
